package io.kiki.sba.registry.common.model.console;

import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;
import java.util.Objects;

@Setter
@Getter
public class PersistenceData implements Serializable {

    private String dataId;

    private String group;

    private String instanceId;

    private long version;

    private String data;


    @Override
    public boolean equals(Object o) {
        if (this == o)
            return true;
        if (o == null || getClass() != o.getClass())
            return false;
        PersistenceData that = (PersistenceData) o;
        return Objects.equals(dataId, that.dataId) && Objects.equals(group, that.group) && Objects.equals(instanceId, that.instanceId) && Objects.equals(version, that.version) && data.equals(that.data);
    }

    @Override
    public int hashCode() {
        return Objects.hash(dataId, group, instanceId, version, data);
    }
}
